//
//  SaleHouseFunctionView.m
//  EhomeBaby
//
//  Created by 李劲成 on 2016/12/30.
//  Copyright © 2016年 李劲成. All rights reserved.
//

#import "SaleHouseToolBar.h"

@interface SaleHouseToolBar ()



@end

@implementation SaleHouseToolBar

- (instancetype)init{
    self = [super init];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        [self createCollect];
        [self createShare];
        [self createContact];
    }
    return self;
}

- (void)createCollect{
    self.collect = [UIButton buttonWithType:UIButtonTypeSystem];
    _collect.layer.borderColor = [CGLTool hexStringToColor:@"#f7f7f7"].CGColor;
    _collect.layer.borderWidth = 0.5;
    [_collect setTitle:@"关注" forState:UIControlStateNormal];
    [_collect setTintColor:[CGLTool hexStringToColor:@"#999999"]];
    [_collect setImage:[UIImage imageNamed:@"Collect"] forState:UIControlStateNormal];
    [_collect setTitleColor:[CGLTool hexStringToColor:@"#999999"] forState:UIControlStateNormal];
    _collect.titleLabel.font = [UIFont fontWithName:@"Heiti SC" size:11];
    [_collect setTitleEdgeInsets:UIEdgeInsetsMake(22, 0, 0, 20)];
    
    [_collect setImageEdgeInsets:UIEdgeInsetsMake(5, 22, 25, 0)];
    

    [self addSubview:_collect];
}
- (void)createShare{
    self.share = [UIButton buttonWithType:UIButtonTypeSystem];
    [_share setTitle:@"已兑换108/剩余92" forState:UIControlStateNormal];
     [_share setTintColor:[CGLTool hexStringToColor:@"#999999"]];
    [_share setTitleColor:[CGLTool hexStringToColor:@"#999999"] forState:UIControlStateNormal];
    _share.titleLabel.font = [UIFont fontWithName:@"Heiti SC" size:11];
    _share.layer.borderColor = [CGLTool hexStringToColor:@"#f7f7f7"].CGColor;
    _share.layer.borderWidth = 0.5;
    [self addSubview:_share];
}
- (void)createContact{
    self.contact = [UIButton buttonWithType:UIButtonTypeSystem];
    [_contact setTitle:@"兑换" forState:UIControlStateNormal];
    [_contact setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_contact setBackgroundColor:[UIColor blueColor]];
    _contact.titleLabel.font = [UIFont fontWithName:@"Heiti SC" size:11];

    [self addSubview:_contact];
}


- (void)layoutSubviews{
    [super layoutSubviews];
   
    _contact.frame = CGRectMake(375 / 2, 0, 375/2, 50);
    _share.frame = CGRectMake(0, 0, 375/2, 50);
    
}

- (void)addContactTarget:(id)target Action:(SEL)action{
    [_contact addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
}
@end
